<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@page import="service.java.Baldor" %>
<%
    String v1 = request.getParameter("v1");
    String v2 = request.getParameter("v2");
    String v3 = request.getParameter("v3");
    String tipo = request.getParameter("tipo");
    
    Baldor baldor = new Baldor();
    String result;
    if(tipo.equals("Mayor Venta")) {
        result = baldor.maximo(v1, v2, v3);
        
    } else if(tipo.equals("Menor Venta")) {
        result = baldor.minimo(v1, v2, v3);
        
    } else {
        result = baldor.promedio(v1, v2, v3);
    }
    
    if(result == null) {
        result = "Valores NO correctos";
    }
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h3 style="text-align: center">Respuesta: <%=result%></h3>
        
        <p style="text-align: center">
            <a href="index.jsp">Volver</a>
        </p>
    </body>
</html>
